package cn.fintecher.gis.entity;

import cn.fintecher.gis.enums.CommonState;
import cn.fintecher.gis.enums.RiskGrand;
import cn.fintecher.gis.enums.SusceptibleGrand;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "land_disaster")
@Data
@Api("隐患点信息")
public class LandDisaster extends BaseEntity{

    @ApiModelProperty(notes = "位置x")
    private Double positionX;

    @ApiModelProperty(notes = "位置Y")
    private Double positionY;

    @ApiModelProperty(notes = "名称")
    private String name;

    @ApiModelProperty(notes = "地灾危险性")
    @Enumerated(EnumType.STRING)
    private RiskGrand grade;

    @ApiModelProperty(notes = "隐患状态")
    @Enumerated(EnumType.STRING)
    private CommonState status;

    @ApiModelProperty(notes = "行政区")
    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "prefecture")
    private DistrictInfo districtInfo;

    @ApiModelProperty(notes = "地灾易发区级别")
    @Enumerated(EnumType.STRING)
    private SusceptibleGrand susceptible;

    @ApiModelProperty(notes = "创建时间")
    private Date createTime;

    @ApiModelProperty(notes = "创建人id")
    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id")
    private Operator operator;
}
